package com.sport.setting.repository;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sport.model.common.dtos.ResponseResult;
import com.sport.model.common.enums.AppHttpCodeEnum;
import com.sport.model.setting.dtos.SportEventsAlmightyDto;
import com.sport.model.setting.pojos.SportEventsAlmighty;
import com.sport.model.user.bos.AccountUserBo;
import com.sport.setting.mapper.SportEventsAlmightyMapper;
import com.sport.utils.common.BaseUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Component
@Transactional
public class SportEventsAlmightyRepository extends ServiceImpl<SportEventsAlmightyMapper, SportEventsAlmighty> {

    @Resource
    private SportEventsAlmightyMapper sportEventsAlmightyMapper;

    public ResponseResult defineAlmightyItem(SportEventsAlmightyDto sportEventsAlmightyDto) {
        if(sportEventsAlmightyMapper.defineAlmightyItem(sportEventsAlmightyDto) > 0){
            return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
        }
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR);
    }
}
